// 导入Vue和VueRouter模块
import Vue from 'vue';
import VueRouter from 'vue-router';
import HelloWorld from '@/components/HelloWorld.vue';
import Test1 from '../views/Test1.vue'
import mainPage from '../views/index.vue'

// 使用VueRouter插件
Vue.use(VueRouter);

// 创建VueRouter实例，并配置路由规则
const router = new VueRouter({
  mode:'hash',
  // 路由配置...
  routes: [
    {
      path: '/test',
      name:'test',
      component: Test1
    },
    {
      path: '/hello',
      name:'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/',
      name:'mianPage',
      component: mainPage
    }

  ]
});

// 创建Vue实例，并注册VueRouter
new Vue({
  // ...
  router, // 注册VueRouter
  // ...
});
export default router
